{extend name="public/base" /}

{block name="title"}控制台{/block}

{block name="main"}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">用户列表</div>
                <div class="layui-card-body">
                    <table class="layui-hide" id="user-list"></table>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}

{block name="js"}
<script>
    layui.use(['index', 'table'], function(){
        var table = layui.table;

        table.render({
            elem: '#user-list'
            ,url: '{:url("index")}'
            ,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
            ,cols: [[
                {field:'id', title: 'ID'}
                ,{field:'nickname', title: '用户名'} //width 支持：数字、百分比和不填写。你还可以通过 minWidth 参数局部定义当前单元格的最小宽度，layui 2.2.1 新增
                ,{field:'sex_text', title: '性别'}
                ,{field:'', title: '头像', templet: 'headimgurl'}
            ]]
        });

    });
</script>
{/block}